*Cloud plot with life earnings - ver 2*

clear


use "Results\fig_A2\data_with_types_ben_updated.dta"

keep if aar==2010
drop if final_educ==. | final_educ==1
sort final_educ


by final_educ: egen level_mean_s=mean(wage_start_mean_ambition_s)
by final_educ: egen growth_mean_s=mean(wage_growth_ambition_s)
by final_educ: egen educ_count=count(final_educ)



collapse (first) level_mean_s growth_mean_s educ_count ambition_type_k_4_s life_earnings_ambition, by(final_educ)

gen educ_code=string(final_educ)

*Plots


*Life earnings types


twoway scatter growth_mean_s level_mean_s if life_earnings_ambition==4 & educ_count>=10 & !missing(life_earnings_ambition), msymbol(diamond_hollow) mcolor(teal) || ///
scatter growth_mean_s level_mean_s if life_earnings_ambition==3 & educ_count>=10 & !missing(life_earnings_ambition), msymbol(square_hollow) mcolor(navy) || ///
scatter growth_mean_s level_mean_s if life_earnings_ambition==1 & educ_count>=10 & !missing(life_earnings_ambition), msymbol(triangle_hollow) mcolor(dkorange) || ///
scatter growth_mean_s level_mean_s if life_earnings_ambition==2 & educ_count>=10 & !missing(life_earnings_ambition), msymbol(circle_hollow) mcolor(maroon) ///
xtitle("starting wage (standardized)") ytitle("growth (standardized)") ///
legend(order(1 "low lifetime earnings" 2 "medium-low lifetime earnings" 3 "medium-high lifetime earnings" 4 "high lifetime earnings") position(6) cols(2) rows(2)) graphregion(fcolor(white)) xscale(range(-2 6)) xlabel(-2(2)6) yscale(range(-5 5.5)) ylabel(-5(5)5)



*EXAMPLES


gen program_name=""

replace program_name="Preschool teacher" if educ_code=="5444" /*Health*/
replace program_name="Nurse" if educ_code=="5166" /*Health*/
replace program_name="Medicin" if educ_code=="7170" /*Health*/

replace program_name="Ordinary HS" if educ_code=="1198" /*Secondary*/
replace program_name="Carpenter" if educ_code=="4283" /*Secondary*/
replace program_name="Office clerk" if educ_code=="4981" /*Secondary*/
replace program_name="Business HS" if educ_code=="5098" /*Secondary*/
replace program_name="Bank advisor" if educ_code=="4986" /*Secondary*/

replace program_name="Teacher" if educ_code=="5440" /*Humanities*/


replace program_name="Architect" if educ_code=="5470" /*STEM NOT one of biggest*/


replace program_name="10th grade" if educ_code=="111084" /*Primary*/


replace program_name="Business grad" if educ_code=="5703" /*Business*/
replace program_name="Business bach" if educ_code=="5700" /*Business*/


replace program_name="Law" if educ_code=="7085" /*Social Science*/

*low lifetime earnings
list if life_earnings_ambition==4 & !missing(program_name)
*10th grade

*medium-low lifetime earnings
list if life_earnings_ambition==3 & !missing(program_name)
*none. Hence, I have to add one
gsort life_earnings_ambition -educ_count 
replace program_name="Painter" if educ_code=="4274"


*medium-high lifetime earnings
list if life_earnings_ambition==1 & !missing(program_name)
* Carpenter, Office clerk, Business HS, Architect, Business bach 

*high lifetime earnings
list if life_earnings_ambition==2 & !missing(program_name)
* Bank advisor, Nurse, Teacher, Business grad , Law, Medicin



*Life earnings types


twoway scatter growth_mean_s level_mean_s if inlist(educ_code, "111084"),  msymbol(diamond_hollow) mcolor(teal) ///
mlab(program_name) mlabc(black) mlabposition(12) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "4274"), msymbol(square_hollow) mcolor(navy) ///
mlab(program_name) mlabc(black) mlabposition(5) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "4283"),  msymbol(triangle_hollow) mcolor(dkorange) ///
mlab(program_name) mlabc(black) mlabposition(1) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "4986"), msymbol(circle_hollow) mcolor(maroon) ///
mlab(program_name) mlabc(black) mlabposition(3) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "4981"), msymbol(triangle_hollow) mcolor(dkorange) ///
mlab(program_name) mlabc(black) mlabposition(3) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "5098"), msymbol(triangle_hollow) mcolor(dkorange) ///
mlab(program_name) mlabc(black) mlabposition(1) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code,"5470"), msymbol(triangle_hollow) mcolor(dkorange) ///
mlab(program_name) mlabc(black) mlabposition(3) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "5700"), msymbol(triangle_hollow) mcolor(dkorange) ///
mlab(program_name) mlabc(black) mlabposition(1) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "5166"), msymbol(circle_hollow) mcolor(maroon) ///
mlab(program_name) mlabc(black) mlabposition(12) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "5440"), msymbol(circle_hollow) mcolor(maroon) ///
mlab(program_name) mlabc(black) mlabposition(3) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code, "5703"), msymbol(circle_hollow) mcolor(maroon) ///
mlab(program_name) mlabc(black) mlabposition(3) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code,"7085"), msymbol(circle_hollow) mcolor(maroon) ///
mlab(program_name) mlabc(black) mlabposition(12) || ///
scatter growth_mean_s level_mean_s if inlist(educ_code,"7170"), msymbol(circle_hollow) mcolor(maroon) ///
mlab(program_name) mlabc(black) mlabposition(1)  ///
xtitle("starting wage (standardized)") ytitle("growth (standardized)") ///
legend(order(1 "low lifetime earnings" 2 "medium-low lifetime earnings" 3 "medium-high lifetime earnings" 4 "high lifetime earnings") position(6) cols(2) rows(2)) graphregion(fcolor(white)) xscale(range(-2 4)) xlabel(-2(2)4) yscale(range(-5 5)) ylabel(-5(5)5)



